<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Spbu extends Authenticated_Controller{
	function __construct() {
		parent::__construct();
		$this->load->model('spbu_model','spbu');
	}
	
	function index(){
		$this->list_spbu();
	}
	
	function list_spbu(){
		$data['daftar_spbu'] = $this->spbu->get_all();
		$this->load->view('template/header_view');
		$this->load->view('spbu/daftar_spbu',$data);
		$this->load->view('template/footer_view');
	}
	
	function form_add_spbu(){
		$this->load->view('template/header_view');
		$this->load->view('spbu/form_add_spbu');
		$this->load->view('template/footer_view');
	}
	
	function process_add_spbu(){
		$this->spbu->insert_new($_POST);
		redirect(SPBU);
	}
	
	function process_delete_spbu($id){
		$this->spbu->delete_old($id);
		redirect(SPBU);
	}
	
	function form_edit_spbu($id){
		$data = $this->spbu->get_one($id);
		$this->load->view('template/header_view');
		$this->load->view('spbu/form_edit_spbu',$data);
		$this->load->view('template/footer_view');
	}
	
	function process_edit_spbu($id){
		$this->spbu->update_old($id,$_POST);
		redirect(SPBU);
	}
}

/* End of file home.php */
/* Location: ./application/controllers/home.php */
